import { Injectable } from '@angular/core';
import { Router ,RouteParams} from '@angular/router-deprecated';
export class GlobalService
{
    private loginStatus:Boolean = true;
    public static apiUrl:string = "http://localhost:8080/kapi";
    private user:any;
    constructor() {
    }

    validateUser(router:Router){
      router.navigate(['Login']);
    }

    setUser(user)
    {
      this.loginStatus = true;
      this.user = user;
    }

    getUser()
    {
      return this.user;
    }

    isLogin()
    {
      return this.loginStatus;
    }

    loginOut()
    {
      this.loginStatus =false;
    }
}
